#include "TNode.h"
#include <iostream>
#include <vector>

using namespace std;

typedef int INTEGER;
typedef int INDEX;
typedef string STRING;
typedef bool BOOLEAN;

	TNode::TNode(){
	_isRoot = false;
	_parent = NULL;
	_leftSibling = NULL;
	_rightSibling = NULL;
	_procLine = -1;
	_level = -1;
	_numOfMoreChild=0;
	_moreChildren =new TNode*[0];
	_index = -1;
	}
	INTEGER TNode::getIndex(){
		return _index;
	}
	void TNode::setIndex(INTEGER num) {
		_index = num;
	}
	INTEGER TNode::getNumOfMoreChild(){
		return _numOfMoreChild;
	
	}
	void TNode::setProcLine(INTEGER lineNum){
		_procLine = lineNum;
	}
	INTEGER TNode::getProcLine(){
		return _procLine;
	}
	void TNode::setLevel(INTEGER xx){
		_level = xx;
	}
	INTEGER TNode::getLevel(){
		return _level;
	}
	void TNode::setNodeType(STRING type){
		_nodeType = type;
	}
	STRING TNode::getNodeType(){
		return _nodeType;
	}
	void TNode::setRoot(){
		_isRoot = true;
	}
	BOOLEAN TNode::checkRoot(){
		return _isRoot;
	}
	void TNode::setParent(TNode *node){
		_parent = node;
	}
	TNode* TNode::getParent(){
		return _parent;
	}

	void TNode::setLeftSibling(TNode* node){
		_leftSibling = node;
	}
	TNode* TNode::getLeftSibling(){
		return _leftSibling;
	}

	void TNode::setRightSibling(TNode *node){
		_rightSibling = node;
	}
	TNode* TNode::getRightSibling(){
		return _rightSibling;
	}
	void TNode::insertMoreChildren(TNode* node){
		 _numOfMoreChild++;
		 TNode** temp = new TNode*[ _numOfMoreChild];
		 for(int i=0;i<_numOfMoreChild-1;i++){
			 temp[i]=_moreChildren[i];
		 }
		  temp[_numOfMoreChild-1]=node;
		  _moreChildren = temp;
	}
	TNode** TNode::getMoreChildren(){
		return _moreChildren;
	}
